using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using NUlid;

namespace StudentVideo.Data.Entities;

/// <summary>
/// 课程视频
/// </summary>
[Table("video")]
[Index(nameof(CourseId), IsUnique = false)]
public class VideoEntity: BaseEntity {
   /// <summary>
   /// 关联课程
   /// </summary>
   [Required]
   [MaxLength(50)]
   public required string CourseId { get; set; }

   public required CourseEntity Course { get; set; }

   /// <summary>
   /// 章节
   /// </summary>
   [Required]
   [MaxLength(100)]
   public required string Chapter { get; set; }

   /// <summary>
   /// 小节
   /// </summary>
   [Required]
   [MaxLength(100)]
   public required string Summary { get; set; }

   /// <summary>
   /// 标题
   /// </summary>
   [Required]
   [MaxLength(100)]
   public required string Title { get; set; }

   /// <summary>
   /// 地址
   /// </summary>
   [MaxLength(200)]
   public string? Url { get; set; }

   /// <summary>
   /// 本地地址(id)
   /// </summary>
   [MaxLength(200)]
   public string? Video { get; set; }
}
